package cn.northsea.mapper;

import cn.northsea.entity.Seek;
import cn.northsea.entity.SeekUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface SeekMapper extends BaseMapper<Seek> {
    List<Seek> findAll(@Param("likename") String likename);
    @Select("select * from seek where zt=0 order by case when title=#{job} then 1 when title=#{s1} then 2 when title=#{s2} then 3 when title=#{s3} then 4 when title=#{s4} then 5 when title=#{s5} then 6 else 7 end asc")
    List<Seek> findAllByJob(@Param("job") String job,@Param("s1") String s1,@Param("s2") String s2,@Param("s3") String s3,@Param("s4") String s4,@Param("s5") String s5);
    @Select("select *from seek where id=#{id} and zt=0")
    Seek findAllById(String id);
    @Select("select *from seek_user where user_id=#{id}")
    SeekUser findUserByUid(String id);
    @Select("select *from seek where uid=#{uid}")
    List<Seek> findAllByUid(String uid);
    @Insert("insert into seek values (null,#{title},#{money},#{educational},#{address},#{workExperience},#{gname},#{information},#{gms},#{uid},1)")
    void addupdate(Seek seek);
    @Select("select * from seek where zt=1")
    List<Seek> findAll1();
    @Update("update seek set zt=0 where id=#{id}")
    void update1(Integer id);
}
